package com.evo.chat.web.domain;

import com.evo.chat.common.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;

/**
 * 留言表
 * @author luwenzheng
 * date 2020-02-07
 */
@Entity
@Table(name = "words")
public class Words extends BaseEntity {

    @NotEmpty(message = "请输入内容")
    private String content;

    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "user_info_id")
    private UserInfo user;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public UserInfo getUser() {
        return user;
    }

    public void setUser(UserInfo user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Words{" +
                "content='" + content + '\'' +
                ", user=" + user +
                '}';
    }
}
